
	/*
	* Entourage
	* Copyright 2011 INF532@Galatasaray University & Vincent Labatut
	*
	* This file is part of Entourage.
	*
	* Entourage is free software: you can redistribute it and/or modify
	* it under the terms of the GNU General Public License as published by
	* the Free Software Foundation, either version 3 of the License, or
	* (at your option) any later version.
	*
	* Entourage is distributed in the hope that it will be useful,
	* but WITHOUT ANY WARRANTY; without even the implied warranty of
	* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
	* GNU General Public License for more details.
	*
	* You should have received a copy of the GNU General Public License
	* along with Entourage. If not, see <http://www.gnu.org/licenses/>.
	*
	*/
	
package com.appspot.entourage.databasemanager;
import javax.persistence.*;


/**
 * This class is used save the link between two person in DB with links weight.
 * @author Yavuz BAYHANTOPCU <yavuz.bayhantopcu@gmail.com>
 * @version 1
 */

@Entity
//@IdClass(com.appspot.entourage.databasemanager.LinkPK) 
public class LinkDB {
	@Id @ManyToOne PersonDB Source;
	@OneToMany	PersonDB Target;
	Integer Weight;
	
	public LinkDB(PersonDB source, PersonDB target, Integer weight){
		this.Source=source;
		this.Target=target;
		this.Weight=weight;
	}

	/**
	 * @return the source Person 
	 */
	public PersonDB getSource() {
		return Source;
	}
	/**
	 * @param the source Person to set
	 */
	public void setSource(PersonDB source) {
		Source = source;
	}
	/**
	 * @return the target Person
	 */
	public PersonDB getTarget() {
		return Target;
	}
	/**
	 * @param the target Person to set
	 */
	public void setTarget(PersonDB target) {
		Target = target;
	}
	/**
	 * @return the weight
	 */
	public Integer getWeight() {
		return Weight;
	}
	/**
	 * @param the link weight to set
	 */
	public void setWeight(Integer weight) {
		Weight = weight;
	}
	
	
}
